import { action, makeObservable, observable } from 'mobx'

export default class Apple {
  constructor (apple) {
    this.appleId = apple.appleId
    this.weight = apple.weight
    this.eaten = false
    makeObservable(this, {
      eaten: observable,
      eatApple: action.bound
    })
  }
  // 吃苹果
  eatApple () {
    this.eaten = true
  }
}